package beans;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;

/**
 * @auther hewenhui
 * @see <a href="hetp://www.codingmaster.com> java </a>
 */

//Controller注解只有一个参数value,给它赋值的时候时候 value可以省略，参数就是用来设置bean的id的
//如果省略参数，id默认为类名首字母小写！
@Controller(value = "useBean")
public class User {
    //给简单类型赋值的注解
    @Value(value = "zhangsan")
    private String name;
    @Value("20")
    private int age;
    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
